var fs = require("fs")
var path = require("path")

function getEntry(entry) {
    return fs.readdirSync(entry)
        .reduce((entries, dir) => {
            const fullDir = path.join(entry, dir);
            const entryJs = path.join(fullDir, dir + '.js');
            if (fs.statSync(fullDir).isDirectory() && fs.existsSync(entry)) {
                entries[dir] = entryJs
            }
            return entries
        }, {});
}
var allEntries = getEntry('./src');

module.exports = allEntries;